<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
	var treeObj = $.fn.zTree.getZTreeObj("_addressTree");
	function _submit(){
		$.post("{base}/address_saveOrUpdateAddress", 
			$('#formAddress').serialize(), 
			function(response) {
				alert("保存成功！");
				$('#_addOrUpdateAddress').dialog('close');
						var node = treeObj.getNodeByParam("id",response.parentid, null);
						treeObj.addNodes(node, {id : response.newid, name : $("#name").val()});
		}, "json");
	}
</script>

	<form id="formAddress"> 
		<input type="hidden" id="parentid" name="parentid" value="{parentid}"/><br>
		<input type="hidden" name="id" /><br>
		地区名称：		<input type="text" name="name"	 id="name"	class="required" minlength="2"/><br>
			<input  type="button" value="提交" onclick="_submit();"/>
			<input  type="reset" value="重置" />
	</form>
